Add monolithic fused packet allreduce kernel and Model::all_reduce_packet API#254
Merged
Conversation
added 5 commits
June 9, 2026 01:31
…pying input into a private buffer before the loop.
…ct buffer aliasing and copy input into a private tensor before the ring loop.
… UNITTEST_SKIP macro (trailing whitespace) to pass PR #253 linter CI.
…(trailing whitespace / misaligned backslash in UNITTEST_SKIP macro) to pass the linters check on PR #253.
…reducePacket CUDA kernel replacing the 3-op decomposition, including all_reduce_packet method stripped from P4.
# Conflicts: # ark/ops/ops_all_reduce_test.cpp # ark/ops/ops_test_common.cpp # ark/unittest/unittest_utils.h
…icts (DIRTY, behind_by=3).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #254 +/- ##
==========================================
+ Coverage 86.88% 86.94% +0.06%
==========================================
Files 125 127 +2
Lines 6113 6088 -25
==========================================
- Hits 5311 5293 -18
+ Misses 802 795 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
added 2 commits
June 10, 2026 07:51
…rmat violations in 9 files), then add real C++ or Python tests for uncovered fused-packet-allreduce paths to raise from 82.47% to ≥86.88%; do not lower the codecov target or add ignore entries.
…rmat violations in 9 files), then add real C++ or Python tests for uncovered fused-packet-allreduce paths to raise from 82.47% to ≥86.88%; do not lower the codecov target or add ignore entries.
chhwang
pushed a commit
that referenced
this pull request
Jun 10, 2026
…esolving any conflicts; cause: BEHIND base by 1 commit (PR #254 merge).
This was referenced Jun 10, 2026
chhwang
added a commit
that referenced
this pull request
Jun 11, 2026
Sync pr-e-python-api with main after PR #254 merge Merge `main` into `pr-e-python-api` to incorporate commit `1cdc3ec` (fused packet allreduce kernel + `Model::all_reduce_packet` API from PR #254). The branch was behind by 1 commit. The merge resolved cleanly with no conflicts. `python/ark/ops.py` auto-merged (both sides added code at different locations). 11 files changed, all from PR #254 content. No new feature code added.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add monolithic fused packet allreduce kernel and Model::all_reduce_packet API
Port mscclpp's
allreducePacketkernel into ARK as a single devicefunction (
allreduce_packet_fusedincomm.h) that fuses the threephases — scatter, reduce, broadcast — into one kernel, synchronized by
LL packet flags instead of cross-block barriers.
Changes (10 files, +402 lines):
ark/include/kernels/comm.h:allreduce_packet_fused<>devicefunction (scatter → reduce → broadcast, ~131 lines).
ark/ops/ops_communication.{hpp,cpp}:ModelOpAllReducePacketFusedclass with
impl_name,impl_args,default_config. Tuningmirrors mscclpp's block/thread heuristics.
ark/model/model_op.cpp: registerAllReducePacketFused.ark/ops/ops_all_reduce.cpp:Model::all_reduce_packet— allocatesscratch, creates peer refs, emits the fused op.
ark/include/ark/model.hpp: declareall_reduce_packet.ark/api/planner.cpp: stampNumProcsinto op Config, guarded byop type
AllReducePacketFused.ark/ops/ops_communication_test.cpp: fixsend_recv_reducetest tocompute
NumTasksfrom tensor shape; add single-GPU model-level testfor
ModelOpAllReducePacketFused.python/model_py.cpp,python/ark/ops.py: bind and wrapall_reduce_packet.Replaces the 3-op decomposition (
send_packet→recv_reduce_send_packet→recv_packet) that incurred per-phasetask-launch overhead and could not fuse across phases.
Known limitations:
Flag = 1hardcoded; per-call flag rotation deferred.NumProcs >= NPeersrequired; compact regime deferred.